/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkgjeudestrategie;

import java.awt.Color;


import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author Alex
 */
class EcranStats extends JPanel {
JLabel lblArgent=new JLabel("$$$");
JLabel lblRecherche=new JLabel("nbr de tours restants, nom de la recherche");
    boolean moving=false;
    int move=-1;
   public EcranStats() {
        super(new GridLayout(0,3));

       
        setBackground(Color.LIGHT_GRAY);
        setEnabled(true);
        add(lblArgent,JLabel.CENTER);
        add(lblRecherche);
        setVisible(true);
        addMouseListener(new MouseAdapter(){
@Override
public void mouseEntered(MouseEvent e)
{
moving=true;
}
            @Override
public void mouseExited(MouseEvent e)
{
moving=false;
}
});
    }
   
   
       public int isMoving() {
       move=-1;
        try {
            if (moving) {
                if (getMousePosition().getX() >= 0&&getMousePosition().getY()==0 ){
                    move=0;
                    if ( getMousePosition().getX() >=getWidth()-205 ) {
                     move= 1;
                } 
                }
                
                if (getMousePosition().getX() >=getWidth()-205 &&getMousePosition().getY() !=0) {
                     move= 2;
                } 
            }
        } catch (Exception e) {
        }

        return  move;
    
       
       
   }
   public void setLblArgent(String s){
       lblArgent.setText(s);
   }
   public void setLblRecherche(String s){
       lblRecherche.setText(s);
        repaint();
       
   }




}
